package com.zynn.service.module.canal.service.impl;

import com.zynn.common.core.utils.TypeConvertUtil;
import com.zynn.feign.module.es.SyncEventFeignService;
import com.zynn.message.queue.constant.MqQueueNameConstant;
import com.zynn.service.module.canal.service.SchoolBeInvitedRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 刘猛
 * @since 2018-09-14
 */
@Service
@Slf4j
public class SchoolBeInvitedRecordServiceImpl implements SchoolBeInvitedRecordService {

    @Autowired
    private SyncEventFeignService syncEventFeignService;

    /*@JmsListener(destination = MqQueueNameConstant.SCHOOL_BE_INVITED_RECORD)
    public void findDegFriend(Map<String, Object> columnsMap) {
        log.info("FIND_FRIEND_FROM_SCHOOL_BE_INVITED_RECORD:{}", columnsMap);
        *//**
         * 助力用户
         *//*
        Long beLikedUserId = TypeConvertUtil.objectToLong(columnsMap.get("be_liked_user_id"));
        if(beLikedUserId == null && beLikedUserId == 0){
            return;
        }
        *//**
         * 被谁邀请进来的用户
         *//*
        Long inviteUserId = TypeConvertUtil.objectToLong(columnsMap.get("invite_user_id"));
        if(inviteUserId!=null && inviteUserId!=0) {
            log.info("计算{}好友-高校版推荐", inviteUserId);
            syncEventFeignService.initFriendVersionSchool(inviteUserId,beLikedUserId);
        }

        *//**
         * 被邀请进来的用户
         *//*
        Long beInviteUserId = TypeConvertUtil.objectToLong(columnsMap.get("be_invited_user_id"));
        if(beInviteUserId!=null && beInviteUserId!=0) {
            log.info("计算{}好友-高校版推荐", beInviteUserId);
            syncEventFeignService.initFriendVersionSchool(beInviteUserId,beLikedUserId);
        }

        *//**
         * 助力用户
         *//*
        if(beLikedUserId!=null && beLikedUserId!=0) {
            log.info("计算{}好友-高校版推荐", beLikedUserId);
            syncEventFeignService.initFriendVersionSchool(beLikedUserId,beLikedUserId);
        }
    }*/
}
